#include <algorithm>
#include <cstdio>
#include <iostream>

using namespace std;

struct node {
    int val, ind;
    node() : val(0), ind(0) {}
    node(int v, int i) : val(v), ind(i) {}
};

bool cmp(node n1, node n2) { return n1.val < n2.val; }

int main() {
        int n;
    double ans = 0;
    node t[2010];
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> t[i].val;
        t[i].ind = i + 1;
    }
    sort(t, t + n, cmp);

    for (int i = 0; i < n; i++) cout << t[i].ind << " ";
    cout << endl;
    for (int i = 0; i < n - 1; i++) {
        ans += t[i].val * (n - i - 1);
    }
    printf("%.2lf", (double)ans / (double)n);
}